/*
 * Range_Calculate.c
 *
 *  Created on: 12/03/2013
 *      Author: Bowmer
 */

#include <stdio.h>
#include <string.h>
#include "UART.h"


void Range(unsigned long reflectTime, unsigned long sendTime, unsigned int nodeNumber, unsigned int measurementNumber){

	unsigned int count;
	float range;
	char outString[50];


	count = (reflectTime-sendTime);
	range = count * 0.0000042875;
	sprintf(outString, "$USRAN,%d,%d,%f\r\n", nodeNumber, measurementNumber, range);

	UART0_Send(outString, strlen(outString));
	UART5_Send(outString, strlen(outString));

}
